#include "porting.h"
#include "fs.h"
#include "errorcode.h"

int fs_open   (LN_THREAD_PTR thrd, fs_context_p fs, const char * path)
{
  memset (fs, 0, sizeof(*fs));

  if ( NULL == realpath (path, fs->path) )
  {
    er_set (thrd, LN_ER_PATH_INVALID, path);
    return er_errid (thrd);
  }

  return 0;
};

int fs_close  (LN_THREAD_PTR thrd, fs_context_p fs)
{
//  struct fs_file * file_p;
  return 0;
};

int fs_read   (LN_THREAD_PTR thrd, fs_context_p fs, LN_OID offset, int size, char* buf)
{
  return 0;
};

int fs_alloc  (LN_THREAD_PTR thrd, fs_context_p fs, LN_OID offset, int size)
{
  return 0;
};

